package cn.jsj.user.manager;

import java.io.IOException;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

/**
 * 添加一位律师助理信息处理类
 * @author LI
 *
 */
 public class AddLawyerAssistInfo extends javax.servlet.http.HttpServlet implements javax.servlet.Servlet {
	 public void service(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
		//调试信息
		  cn.jsj.utils.SysLogger.PrintInfo("添加一位律师助理信息");

		  //新建律师助理对象
		  cn.jsj.pojo.TblLawyAssistant tla=new cn.jsj.pojo.TblLawyAssistant();

		  //赋值
		  tla.setBirthTime(cn.jsj.utils.TimeDispose.transferDate(request.getParameter("aassistbirthtime").trim()));
		  tla.setDeleteLabel(0);
		  tla.setEducationalLevel(request.getParameter("aassisteducationallevel").trim());
		  tla.setGraduateSchool(request.getParameter("aassistgraduateschool").trim());
		  tla.setGuidTeacher(Integer.parseInt(request.getParameter("guidteacher")));
		  tla.setIdentityNumber(request.getParameter("aassistidentitynumber").trim());
		  tla.setLawAgreement(Integer.parseInt(request.getParameter("pracagreement").trim()));
		  tla.setLawAssisEmail(request.getParameter("aassistlawyeremail").trim());
		  tla.setLawAssisName(request.getParameter("alawyerassistname").trim());
		  tla.setLawAssisPhone(request.getParameter("aassistidentitynumber").trim());
		  tla.setLawAssisSex(request.getParameter("sex").trim());
		  tla.setLawyerPwd("111111");
		  tla.setPoliticalStatus(request.getParameter("aassistpoliticalstatus").trim());
		  tla.setPracticeNumber(request.getParameter("aassistnumber").trim());



		  //新属性
		  tla.setArchiveAddr(request.getParameter("aassistarchiveaddr").trim());
		  tla.setHouseholeAddr(request.getParameter("aassisthouseholdaddr").trim());
		  tla.setStartTime(cn.jsj.utils.TimeDispose.transferDate(request.getParameter("aassisttime").trim()));
		  tla.setEndTime(cn.jsj.utils.TimeDispose.transferDate(request.getParameter("aassistendtime").trim()));
		  tla.setFrontOccupation(request.getParameter("aassistfrontoccup").trim());
		  tla.setEligibleNumb(request.getParameter("aassisteligiblenumb").trim());
		  //调试信息
		  cn.jsj.utils.SysLogger.PrintInfo("赋值完成");

		  //保存律师助理信息
		  cn.jsj.dao.TblLawyAssistantDAO tlad=new cn.jsj.dao.TblLawyAssistantDAO();
		  //保存
		  int saveResult=tlad.saveLawyerAssist(tla);

		  //输出流
			 java.io.PrintWriter out=response.getWriter();
			 if(saveResult==1){
				 out.println("{message:'添加成功！'}");
			 }else{
				 out.println("{message:'添加失败！'}");
			 }

			 out.flush();
			 out.close();
	}
}